package com.woniuxy.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.woniuxy.entity.Perms1;
import com.woniuxy.entity.Role1;
import com.woniuxy.entity.User1;
import com.woniuxy.mapper.User1Mapper;
import com.woniuxy.service.User1Service;

@Service

public class User1ServiceImpl implements User1Service{
	@Autowired
	private User1Mapper userMapper;
	
	@Override
	public User1 findUserByAccount(String account) {
		
		return userMapper.findUserByAccount(account);
	}

//	@Override
//	public int updateHeadImg(User1 user) {
//	
//		return userMapper.updateHeadImg(user);
//	}
	@Cacheable(value="findRolesAndPerms")
	@Override
	public User1 findRolesAndPerms(String account) {
		// TODO Auto-generated method stub
		return userMapper.findRolesAndPerms(account);
	}

	@Override
	public List<User1> all() {
		
		return userMapper.all();
	}

	@Override
	public int addUser1AndRole1(int uid, int rid) {
		
		return userMapper.addUser1AndRole1(uid, rid);
	}

	@Override
	public int addRole1AndPerms1(int rid, int pid) {
		// TODO Auto-generated method stub
		return userMapper.addRole1AndPerms1(rid, pid);
	}

	

}
